import request from '@/utils/request'
import { base_url } from '@/api/config'

export function getVerifyCode(data) {
  return request({
    url: base_url + '/user/mail',
    method: 'post',
    data
  })
}

export function register(data) {
  return request({
    url: base_url + '/user/register',
    method: 'post',
    data
  })
}

export function login(data) {
  return request({
    url: base_url + '/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: base_url + '/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: base_url + '/user/logout',
    method: 'post'
  })
}

export function keepConnect() {
  return request({
    url: base_url + '/user/keep',
    method: 'get'
  })
}
